SRC=$(wildcard src/*.cpp)
OBJ=$(patsubst %.cpp, %.o, $(SRC))
DLL=cal
DLL_FULL_PATH=lib/libcal.so

app.out: app.cpp $(OBJ) $(DLL_FULL_PATH)
	echo $(SRC)
	echo $(OBJ)
	echo $(DLL)
	echo $(DLL_FULL_PATH)
	g++ app.cpp -L lib/ -l $(DLL) -o app.out
	export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/shiyuxin/CPPServer/01_MakeFileTurtoial/lib && ./app.out

src/%.o: src/%.cpp
	g++ -c -fpic $< -o $@

$(DLL_FULL_PATH): $(OBJ)
	g++ -shared $(OBJ) -o $(DLL_FULL_PATH)

.PHONY:clean
clean:
	rm $(OBJ)
